<template>
  <div class="shopcar">
    <div class="mui-numbox" data-numbox-min='1' style="height:25px">
        <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
        <input id="test" class="mui-input-numbox" type="number" :value="initcount" @change="countedChange" ref="numberBox" readonly/>
        <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
    </div>
  </div>
</template>

<script>
// 导入mui'的js组件
import mui from '../../lib/mui/js/mui.min.js'
export default {

  data () {
    return {
    }
  },

  methods: {
    countedChange(){
        //    console.log(this.$refs.numberBox.value)
    this.$store.commit("getUpdataCount", {
        id:this.goodsid,
        count: this.$refs.numberBox.value,
    })
    }
  },

  created () {
  },
  mounted () {
    mui('.mui-numbox').numbox();
    // console.log(this.max);
  },
  props: ["initcount", "goodsid"]
}
</script>

<style lang='less'>
.shopcar{
    display: inline-block;
}
</style>
